<?php

namespace App\Http\Presenters;

use Laracasts\Presenter\Presenter;


class PublishPresenter extends Presenter
{

    public function LimitStatus()
    {
        switch ($this->limit) {
            case 0:
                return '<span class="green">无</span>';
                break;

            default:
                return $this->limit;
                break;
        }
    }


    public function PublishStatus()
    {
        switch ($this->status) {
            case 1:
                return '<span class="green">发布</span>';
                break;

            default:
                return '<span class="grey">撤销</span>';
                break;
        }
    }


    public function EnrolStatus()
    {
        if ($this->started == 0 && $this->ended == 0)
            return '<i class="weui-icon-info-circle"></i>报名未开始';

        if ($this->started == 1 && $this->ended == 0)
            return '<i class="weui-icon-success"></i>报名进行中';

        if ($this->ended == 1)
            return '<i class="weui-icon-warn"></i><span style="color:#f76260;">报名已结束</span>';

    }

}
